package com.ruoyi.report_sj.mapper;

import com.ruoyi.report_sj.domain.ReportSjkyqdBaDetail;
import com.ruoyi.report_sj.domain.vo.ReportSjkyqdBaDetailVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 砂浆抗压强度试验检测记录详情Mapper接口
 *
 * @author zyb
 * @date 2024-05-29
 */
public interface ReportSjkyqdBaDetailMapper extends BaseMapperPlus<ReportSjkyqdBaDetailMapper, ReportSjkyqdBaDetail, ReportSjkyqdBaDetailVo> {

    @Select("select * from report_sjkyqd_ba_detail where excel_id = #{excelId} and del_flag = 0")
    List<ReportSjkyqdBaDetail> selectListByExcelId(Long excelId);


    @Delete("delete from report_sjkyqd_ba_detail where excel_id = #{excelId}")
    void deleteByExcelId(Long excelId);

    @Select("select kyqd.* from report_sjkyqd_ba_detail kyqd,syrw_ref_report_excel ref,syrw_bi_excel_type bi where ref.excel_type_id = bi.excel_type_id and kyqd.excel_id = ref.excel_id " +
        " and ref.report_id = (select report_id from syrw_ref_report_excel where excel_id = #{excelId}) and bi.label ='sjkyqd' ")
    List<ReportSjkyqdBaDetail> selectListByBgExcelId(Long excelId);
}
